home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Astromatch / Astro.jar / Astro / CMidlet.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-05-06  |  3.3 KB  |  118 lines

  1. package Astro;
  2.  
  3. import java.util.Random;
  4. import javax.microedition.lcdui.Command;
  5. import javax.microedition.lcdui.CommandListener;
  6. import javax.microedition.lcdui.Display;
  7. import javax.microedition.lcdui.Displayable;
  8. import javax.microedition.lcdui.List;
  9. import javax.microedition.midlet.MIDlet;
  10. import javax.microedition.midlet.MIDletStateChangeException;
  11.  
  12. public class CMidlet extends MIDlet implements CommandListener {
  13.    // $FF: renamed from: int javax.microedition.lcdui.Command
  14.    static Command field_0 = new Command("Exit", 7, 99);
  15.    // $FF: renamed from: if javax.microedition.lcdui.Command
  16.    static Command field_1 = new Command("New Profile", 1, 80);
  17.    // $FF: renamed from: new javax.microedition.lcdui.Command
  18.    static Command field_2 = new Command("View Profiles", 1, 70);
  19.    // $FF: renamed from: char javax.microedition.lcdui.Command
  20.    static Command field_3 = new Command("Match Rate", 8, 80);
  21.    // $FF: renamed from: do javax.microedition.lcdui.Command
  22.    static Command field_4 = new Command("Delete profile", 8, 90);
  23.    // $FF: renamed from: byte javax.microedition.lcdui.Command
  24.    static Command field_5 = new Command("Back", 2, 99);
  25.    // $FF: renamed from: for javax.microedition.lcdui.Command
  26.    static Command field_6 = new Command("OK", 4, 99);
  27.    // $FF: renamed from: try java.util.Random
  28.    static Random field_7 = new Random();
  29.    // $FF: renamed from: case Astro.CMidlet
  30.    static CMidlet field_8;
  31.    // $FF: renamed from: a Astro.h
  32.    static h field_9;
  33.  
  34.    public void commandAction(Command var1, Displayable var2) {
  35.       if (var1 == List.SELECT_COMMAND || var1 == field_3) {
  36.          field_9.c = new f(field_9.g.for.getSelectedIndex());
  37.          Display.getDisplay(field_8).setCurrent(field_9.c.byte);
  38.          field_9.c.byte.setCommandListener(this);
  39.          field_9.char();
  40.          h.h = 7;
  41.       }
  42.  
  43.       if (var1 == field_4) {
  44.          h.q.removeElementAt(field_9.g.for.getSelectedIndex());
  45.          field_9.g.for.delete(field_9.g.for.getSelectedIndex());
  46.       }
  47.  
  48.       if (var1 == field_5) {
  49.          Display.getDisplay(field_8).setCurrent(field_9);
  50.          field_9.try();
  51.          field_9.p.a();
  52.          h.h = 2;
  53.       }
  54.  
  55.       if (var1 == field_6) {
  56.          Display.getDisplay(field_8).setCurrent(field_9);
  57.          field_9.f.byte = field_9.f.else.getString();
  58.          if (field_9.f.byte.compareTo("") != 0) {
  59.             field_9.f.a();
  60.             h.h = 5;
  61.          } else {
  62.             field_9.f.if();
  63.             field_9.try();
  64.             field_9.p.a();
  65.             h.h = 2;
  66.          }
  67.       }
  68.  
  69.       if (var1 == field_1) {
  70.          field_9.case();
  71.          field_9.p.if();
  72.          field_9.f = new e();
  73.          Display.getDisplay(field_8).setCurrent(field_9.f.goto);
  74.          field_9.f.goto.setCommandListener(this);
  75.          field_9.f.goto.addCommand(field_6);
  76.          h.h = 4;
  77.       }
  78.  
  79.       if (var1 == field_2 && h.q.size() > 0) {
  80.          field_9.case();
  81.          field_9.p.if();
  82.          field_9.g = new b();
  83.          Display.getDisplay(field_8).setCurrent(field_9.g.for);
  84.          field_9.g.for.setCommandListener(this);
  85.          field_9.int();
  86.          h.h = 6;
  87.       }
  88.  
  89.       if (var1 == field_0) {
  90.          try {
  91.             this.destroyApp(false);
  92.             ((MIDlet)this).notifyDestroyed();
  93.          } catch (MIDletStateChangeException var4) {
  94.          }
  95.       }
  96.  
  97.    }
  98.  
  99.    public void startApp() throws MIDletStateChangeException {
  100.       System.gc();
  101.       field_8 = this;
  102.       field_9 = new h();
  103.       Thread var1 = new Thread(field_9);
  104.       Display.getDisplay(field_8).setCurrent(field_9);
  105.       field_9.setCommandListener(this);
  106.       var1.start();
  107.    }
  108.  
  109.    public void pauseApp() {
  110.    }
  111.  
  112.    public void destroyApp(boolean var1) throws MIDletStateChangeException {
  113.       field_9.else();
  114.       System.gc();
  115.       Display.getDisplay(this).setCurrent((Displayable)null);
  116.    }
  117. }
  118.